import * as types from './actionTypes'

export default (state = {
  user: {}
}, action) => {
  switch (action.type) {
    case types.UPDATE_USER:
      const newState = JSON.parse(JSON.stringify(state))
      newState.user = action.user
      return newState
    default:
      return state
  }
}